" Basic Key Mappings

nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l

" g Leader key
let mapleader=","
nnoremap cc <leader>cc
"nnoremap <Space> <Nop>
" Better indenting
vnoremap < <gv
vnoremap > >gv

" Simulate same TAB behavior in VSCode
nnoremap <silent> <Tab> :bn<CR>
nnoremap <silent> <S-Tab> :bp<CR>
noremap <Leader><Tab> :Bw<CR>
noremap <Leader><S-Tab> :Bw!<CR>

inoremap jk <Esc>
inoremap kj <Esc>

" Alternate way to save
nnoremap <silent> <C-s> :w<CR>
" Alternate way to quit
nnoremap <silent> <C-Q> :wq!<CR>
" Use control-c instead of escape
nnoremap <silent> <C-c> <Esc>

nnoremap <silent> <C-Up>    :resize -2<CR>
nnoremap <silent> <C-Down>  :resize +2<CR>
nnoremap <silent> <C-Left>  :vertical resize -2<CR>
nnoremap <silent> <C-Right> :vertical resize +2<CR>

" Open init.vim

" paste
nnoremap <leader>p "+p
inoremap ,p <C-r>+

" reload the current vimrc file
nnoremap <leader>r :w<CR>:source %<CR>

